/*
 * @Author: 谢小康 2170673706@qq.com
 * @Date: 2023-11-23 17:24:07
 * @LastEditors: 谢小康 2170673706@qq.com
 * @LastEditTime: 2024-01-19 13:46:48
 * @FilePath: \my_bolg_admin\my_admin\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createApp } from 'vue'
import App from './App.vue'
import './style/tailwind.css'
import "./style/base.css"
import router from './router/index.js'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'default-passive-events'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import piniaPluginPersist from "pinia-plugin-persist";
import 'element-plus/theme-chalk/dark/css-vars.css';
import { dealWithRoute } from "./util/premission.js"
import { usePremission } from './store/premission.js'
const pinia = createPinia()

pinia.use(piniaPluginPersist)
let app = createApp(App)

app.use(pinia)
const addRouter = () => {
  if (localStorage.getItem("islogin")) {
    let routerlist = JSON.parse(localStorage.getItem("routerlist"))
    dealWithRoute(routerlist)
  }else{
    return
  }
}
addRouter()
app.use(ElementPlus, {
  locale: zhCn,
})



app.use(router);

app.mount('#app')
